package com.sample.client.vm

import android.util.Log
import com.sample.client.kt.HttpRepository
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response

private const val tag = "HttpViewModel"

class HttpViewModel : BaseViewModel<HttpRepository>(HttpRepository()), Callback<String?> {

    /*private val _listCallback = MutableLiveData<ResponseCallback<List<TaskBean>>>()
    val listCallback: LiveData<ResponseCallback<List<TaskBean>>> = _listCallback*/

    fun load(url: String) {
        viewModelLaunch(block = { repo.request(url) }) {
            Log.e(tag, "load: $it")
        }
    }

    override fun onResponse(call: Call<String?>, response: Response<String?>) {
    }

    override fun onFailure(call: Call<String?>, t: Throwable) {
    }
}